package com.petter.gradlespringboot.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author : GD
 * @date :2021/6/29 : 22:37
 */
public class UserJDKProxy implements InvocationHandler {

    private Object target;

    public UserJDKProxy(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("this is proxy before");
        Object retVal = method.invoke(target, args);
        System.out.println("this is proxy after");
        return retVal;
    }


}
